Register mapping with multiple instruction sets

ABSTRACT

A processor core supports execution of program instruction from both a first instruction set and a second instruction set. An architectural register file  18  containing architectural registers is shared by the two instruction sets. The two instruction sets employ logical register specifiers which for at least some values of those logical registers specifiers correspond to different architectural registers within the architectural register file  18.  A first decoder  4  for the first instruction set and a second decoder  6  for the second instruction set serve to decode the logical register specifiers to a common register addressing format. This common register addressing format is used to supply register specifiers to renaming circuitry  10  for supporting register renaming in conjunction with a physical register file  16  and an architectural register file  18.

BACKGROUND OF THE INVENTION

This application is a continuation of U.S. patent application Ser. No.13/309,732, filed Dec. 2, 2011, the entire contents of which are herebyincorporated by reference in this application.

FIELD OF THE INVENTION

This invention relates to the field of data processing systems. Moreparticularly, this invention relates to the field of data processingsystems supporting multiple different instruction sets.

DESCRIPTION OF THE PRIOR ART

It is known to provide data processing systems supporting multipleinstruction sets. For example, known processes designed by ARM Limitedof Cambridge, England support both the ARM and the Thumb instructionsets. These instruction sets share a register file and share a mappingbetween register specifiers and registers within that register file.

The ARM and Thumb instruction sets referred to above are closely relatedand accordingly it is possible for the same mapping to be used betweenregister specifiers and architectural registers storing operands.However, it may be desirable to support instruction set architectureswith a significant degree of difference between the ways in whicharchitectural registers are addressed by program instructions of thosedifferent instruction sets. One way of dealing with this is to provideseparate mechanisms for the register addressing to be used by theinstructions from the different instruction set. However, thisdisadvantageously increases the required circuit resources and powerconsumption.

SUMMARY OF THE INVENTION

Viewed from one aspect the present invention provides an apparatus forprocessing data comprising:

processing circuitry configured to perform processing operations;

an architectural register file having a plurality of architecturalregisters for storing operand values;

first decoder circuitry configured to decode program instructions of afirst instruction set to generate control signals for controlling saidprocessing circuitry to perform processing operations; and

second decoder circuitry configured to decode program instructions of asecond instruction set to generate control signals for controlling saidprocessing circuitry to perform processing operations; wherein

program instructions of said first instruction set include first logicalregister specifiers specifying first logical registers holding operandvalues, said first logical registers corresponding to architecturalregisters within said architectural register file and having a pluralityof different sizes corresponding to different numbers of words of dataup to a maximum number of words of data;

program instructions of said second instruction set include secondlogical register specifiers specifying second logical registers holdingoperand values, said second logical registers corresponding toarchitectural registers within said architectural register file andhaving a plurality of different sizes corresponding to different numbersof words of data up to said maximum number of words of data;

said first decoder circuitry is configured to map said first logicalspecifiers using a first mapping to a common address format;

said second decoder circuitry is configured to map said second logicalspecifiers using a second mapping to said common address format; and

said second mapping is divergent from said first mapping such that atleast some values used as both a first logical register specifier and asecond logical register specifier map to different architecturalregisters.

The present invention recognises that the first decoder's circuitry andthe second decoder's circuitry used to decode program instructions ofrespective instruction sets may be configured to map their registerspecifiers to a common address format despite the divergence betweenthem in which some values used as both first logical register specifiersand second logical register specifiers are mapped to differentarchitectural registers. The resolving of the different mappings into acommon address format permits a common (shared) set of subsequentcircuitry to be used for the processing of register specifiers usingthat common address format thereby permitting a reduction in circuitoverhead and power consumption.

In some embodiments the architectural registers may be addressed as anarray of architectural registers arranged as a plurality of banks and aplurality of rows with the common addressed format comprising a bankspecifier and a row specifier within the array. In this way, the bankspecifier and the row specifier may be viewed as Cartesian coordinatesfor addressing a particular architectural register within an array ofarchitectural registers.

In some embodiments the plurality of banks permit first logicalregisters and second logical registers having the maximum number ofwords to be stored within a single row of the array. Storing operands ofthe maximum size within a single row facilitates the use of single portaccess to the register file thereby reducing circuit overhead andcomplexity.

The first mapping and the second mapping may take a variety of differentforms. In some embodiments one of the first logical registers of themaximum number of words corresponds to a group of architectural registerthat are all mapped by the first mapping to a plurality of logicalregisters at each different lower size. Thus, for example, a single quadword register may correspond to two double word registers and foursingle word registers.

Either in combination with the above, or separate therefrom, the secondmapping may be such that one of the second logical registers of themaximum number of words corresponds to a group of architecturalregisters at least one of which is mapped by the second mapping to asingle second logical register at each different lower size. Thus, aquad word register corresponds to a single double word register (withsome excess space) and a single single word register (with some excessspace).

Within embodiments utilizing register naming there may be provided aplurality of physical registers configured to store data values to bemanipulated and renaming circuitry configured to store register mappingdata mapping between a bank specifier value and a row specifier valueidentifying an architectural register and one of the physical registersto be used in place of the architectural register for speculativeexecution of a program instruction. Thus, the common register addressingformat may be used as an input to common renaming circuitry.

In circumstances where a plurality of architectural registers correspondto one of the first logical register or the second logical register,energy may be saved by identifying the plurality of architecturalregisters using a single architectural register value in the commonaddress format and a size qualifier to indicate how many of thearchitectural registers are combined with the one specified in thesingle architectural register value.

Viewed from another aspect present invention provides an apparatus forprocessing data comprising:

processing means for performing processing operations;

a plurality of architectural register means for storing operand values;

first decoder means for decoding program instructions of a firstinstruction set to generate control signals for controlling saidprocessing means to perform processing operations; and

second decoder means for decoding program instructions of a secondinstruction set to generate control signals for controlling saidprocessing means to perform processing operations; wherein

program instructions of said first instruction set include first logicalregister specifiers specifying first logical register means for holdingoperand values, said first logical register means corresponding toarchitectural register means and having a plurality of different sizescorresponding to different numbers of words of data up to a maximumnumber of words of data;

program instructions of said second instruction set include secondlogical register specifiers specifying second logical register means forholding operand values, said second logical register means correspondingto architectural register means and having a plurality of differentsizes corresponding to different numbers of words of data up to saidmaximum number of words of data;

said first decoder means maps said first logical specifiers using afirst mapping to a common address format;

said second decoder means maps said second logical specifiers using asecond mapping to said common address format; and

said second mapping is divergent from said first mapping such that atleast some values used as both a first logical register specifier and asecond logical register specifier map to different architecturalregister means.

Viewed from a further aspect the invention provides a method ofprocessing data comprising the steps of:

performing processing operations with processing circuitry;

storing operand values in a plurality of architectural registers of anarchitectural register file;

decoding program instructions of a first instruction set to generatecontrol signals for controlling said processing circuitry to performprocessing operations; and

decoding program instructions of a second instruction set to generatecontrol signals for controlling said processing circuitry to performprocessing operations; wherein

program instructions of said first instruction set include first logicalregister specifiers specifying first logical registers holding operandvalues, said first logical registers corresponding to architecturalregisters within said architectural register file and having a pluralityof different sizes corresponding to different numbers of words of dataup to a maximum number of words of data;

program instructions of said second instruction set include secondlogical register specifiers specifying second logical registers holdingoperand values, said second logical registers corresponding toarchitectural registers within said architectural register file andhaving a plurality of different sizes corresponding to different numbersof words of data up to said maximum number of words of data; furthercomprising the steps of:

using a first mapping to map said first logical specifiers to a commonaddress format; and

using a second mapping to map said second logical specifiers to saidcommon address format; wherein

said second mapping is divergent from said first mapping such that atleast some values used as both a first logical register specifier and asecond logical register specifier map to different architecturalregisters.

The above, and other objects, features and advantages of this inventionwill be apparent from the following detailed description of illustrativeembodiments which is to be read in connection with the accompanyingdrawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 schematically illustrates a data processing apparatus includingdecoding circuitry, renaming circuitry, register circuitry andprocessing circuitry:

FIG. 2 schematically illustrates a first mapping between logicalregister specifiers and architectural registers and a second mappingbetween logical register specifiers and architectural registers;

FIG. 3 schematically illustrates an architectural register filecontaining registers of different sizes:

FIG. 4 schematically illustrates a common register address format:

FIGS. 5A, 5B and 5C schematically illustrate a first register mapping:

FIGS. 6A, 6B and 6C schematically illustrate a second register mapping:and

FIG. 7 is a flow diagram and schematically illustrating how logicalregister specifiers may be mapped to a common format using either afirst mapping or a second mapping.

DESCRIPTION OF THE EMBODIMENTS

FIG. 1 schematically illustrates a portion 2 of a data processingapparatus. The data processing apparatus may be a processor coresupporting out-of-order program instruction execution. It will beappreciated that such a processor core will typically contain many morecircuit elements that are illustrated in FIG. 1. These additionalcircuit elements have been omitted from FIG. 1 for the sake of clarity.

The circuitry of FIG. 1 includes first decoder circuitry 4 and seconddecoder circuitry 6 which receive program instruction from a memory (notillustrated) and decode these instruction using respectively a firstmapping and a second mapping to produce register specifiers having acommon register address format (atag).

It will be appreciated that the first decoder circuitry 4 and seconddecoder circuitry 6 will typically produce many other outputs, such ascontrol signals for controlling other aspects of the processor core,such as the processing circuitry 8 which performs the processingoperations specified by the program instruction.

The common register address format register specifiers output by thefirst decoder 4 and the second decoder 6 are supplied to renamingcircuitry 10 which includes register mapping data 12 and a free list 14.The renaming circuitry 10 applies register renaming techniques, astypically used in out-of-order processors, to generate a renamedregister specifier (rtag). This renamed register specifier is suppliedto a physical register file 16 which together with an architecturalregister file 18 and commit queue 20 form part of register circuitry 22.The physical registers in the physical register files 16 are used forstoring speculative operands. When these operands becomenon-speculative, the commit queue circuitry 20 manages their writing(retirement) into the architectural register file 18. The registermapping data 12 tracks which architectural registers are mapped to whichphysical registers. The free list 14 tracks which physical registers areavailable for allocation to store speculative operand values inaccordance with register renaming techniques.

The renamed register specifiers produced by the renaming circuitry 10also include the destination tag identifying the destination physicalregister for a program instruction. When an architectural register isnot currently mapped to any physical register, the common registeraddress format register specifier may be used by the architecturalregister file 18 to supply the required operand to the processingcircuitry 8.

It will be appreciated by those familiar with this technical field thatthe portion of the processor shown in FIG. 1 may additionally includedispatch and issue mechanisms disposed between the renaming circuitryand the processing circuitry and the register circuitry. These dispatchand issue mechanisms will receive the renamed register specifiers andthe common register address format register specifiers and pass theseforward to the processing circuitry 8 and the register circuitry 22.

FIG. 2 schematically illustrates a first mapping and a second mappingbetween logical register specifiers and architectural registers withinthe architectural register file 18. The three columns for each mappingrepresent the same addressable entity accessed with different registerwidths. In the case of the first mapping, a single quad word logicalregister is stored within four architectural registers. These fourarchitectural registers may also be addressed using two logical registerspecifiers for double word operands or four logical register specifiersfor single word operands as illustrated.

The correspondence between the elements within the columns is such thatS1 in the first mapping corresponds to the block immediately below S0 inthe second mapping. The same position within the diagrams showing thefirst and second mappings corresponds to the same physical registerstorage locations—for example S2 in the first mapping corresponds to theblock S0 in the first mapping and S4 from the first mapping correspondsto S1 in the second mapping as shown in FIGS. 5B and 6B discussed below.

In accordance with the second mapping a logical register specifier for aquad word operand again corresponds to four architectural registers.However, in this case these four architectural registers may be used tostore either a single double word logical register or a single singleword logical register. These two mappings are divergent in that it willbe seen that a single value of a logical register specifier (asspecified by a program instruction) such as “S1” maps to differentarchitectural registers when subject to the first mapping compared towhen subject to the second mapping.

FIG. 3 schematically illustrates the architectural register file 18. Thearchitectural register file is composed of four banks of architecturalregisters with each of these banks containing 32 architecturalregisters. Thus, the architectural register file 18 comprises an arrayof registers including four banks and 32 rows. An individualarchitectural register within the architectural register file may beaddressed using a 2-bit bank specifier and a 5-bit row specifier. Inpractice, if the register being addressed is greater in size than asingle architectural register, then it may be specified using a singlerow specifier and bank specifier value together with a size fieldindicating how many architectural registers together form the logicalregister being manipulated.

FIG. 3 shows how the architectural register file may contain a mixtureof quad word operands, double word operands and single word operandsstored within respective architectural registers.

FIG. 4 illustrates the common register addressing format generated bythe first decoder 4 and the second decoder 6. This common registeraddressing format comprises 5-bits of row specifier, 2-bits of bankspecifier and a field specifying the size of the register in terms ofthe number of architectural registers it comprises in total. Another wayto consider this common register addressing format is that each rowwithin the architectural register file 18 comprises a quad word with theindividual registers being addressed by the bank specifier and the sizeindicating the number of architectural registers treated together asstoring that logical register value. Double word registers are evenaligned within the architectural register file 18.

The general format of the register specifiers illustrated in FIGS. 5A,5B, 5C, 6A, 6B and 6C is that in the left hand illustration the logicalspecifier is given and in the right hand illustration the commonregister address format is given.

FIGS. 5A, 5B and 5C illustrate in more detail the first example mappingused respectively for double word registers, single word registers andquad word registers. The double word registers are even aligned and eachcorresponds to two architectural registers within one of the rows of thearchitectural register file 18. The single word registers are notconstrained to odd or even alignment and each corresponds to a singlearchitectural register within one of the rows of the array. The quadword registers are aligned such that each corresponds to a complete rowwithin the architectural file array. Thus, a single write port may beused to write a full quad word operand into the array and a single readport used to read a full quad word operand from the array.

FIGS. 6A, 6B and 6C respectively indicate the second example mappingused for double word registers, single word registers and quad wordregisters. The double word registers of the logical register specifiersof the second instruction set only map to bank0 and bank1. Otherinstructions may be provided which will provide access to the otherarchitectural registers within bank2 and bank3. These will not howeverbe directly accessible using double word logical register specifiers asemployed by the program instructions of the second instruction set.

FIG. 6B illustrates the second mapping used for single word registers.All of the logical specifiers for the single word registers are mappedto the architectural registers within bank0. Again, the architecturalregisters in the other banks may be accessed by other instructions butnot directly used in single word logical register specifiers.

The second mapping used for quad word registers is such that eachlogical register specifier corresponds to a row within the array.

FIG. 7 schematically illustrates a flow diagram of how a logicalregister specifier may be mapped to a common format register specifier.It will be appreciated that the flow diagram of FIG. 7 is arepresentation of what may be considered logically to take place but inpractice the hardware used to implement such behaviour may operate in adifferent manor with a different sequence of events.

At step 24, processing waits until an instruction is received. Step 26determines whether or not that instruction is from the first instructionset. If the instruction is from the first instruction set, then step 28applies a first mapping (see FIGS. 5A, 5B and 5C) to form a commonregister addressing format register specifier. Processing then proceedsto step 30 where the common format register specifier (including thesize indicating the number of architectural registers concerned) isissued to the renaming circuitry 10.

If the determination at step 26 is that the instruction received is notfrom the first instruction set, then the instruction will be from thesecond instruction set and processing proceeds to step 32 at which thesecond mapping is applied between the logical register specifier and thecommon format register specifier (see FIGS. 6A, 6B and 6C). Processingagain proceeds subsequent to this mapping to step 30.

Although illustrative embodiments of the invention have been describedin detail herein with reference to the accompanying drawings, it is tobe understood that the invention is not limited to those preciseembodiments, and that various changes and modifications can be effectedtherein by one skilled in the art without departing from the scope andspirit of the invention as defined by the appended claims

We claim:
 1. Apparatus for processing data comprising: a register filehaving a plurality of registers for storing operand values; firstdecoder circuitry configured to decode program instructions of a firstinstruction set; and second decoder circuitry configured to decodeprogram instructions of a second instruction set; wherein programinstructions of said first instruction set include first logicalregister specifiers; program instructions of said second instruction setinclude second logical register specifiers; said first decoder circuitryis configured to map said first logical specifiers using a first mappingto a common address format; said second decoder circuitry is configuredto map said second logical specifiers using a second mapping to saidcommon address format; and said second mapping is divergent from saidfirst mapping such that at least some values used as both a firstlogical register specifier and a second logical register specifier mapto different registers.
 2. Apparatus as claimed in claim 1, wherein saidplurality of registers are addressed as an array of architecturalregisters arranged in a plurality of banks and a plurality of rows andsaid common address format comprises a bank specifier and a rowspecifier within said array.
 3. Apparatus as claimed in claim 2, whereinsaid plurality of banks permit first logical registers and secondlogical registers having said maximum number of words to be stored in asingle row of said array.
 4. Apparatus as claimed in claim 1, whereinsaid first logical register specifiers specify first logical registerscorresponding to architectural registers within said register filehaving a plurality of different sizes corresponding to different numbersof words of data up to a maximum number of words of data; and one ofsaid first logical registers of said maximum number of words correspondsto a group of architectural registers that are all mapped by said firstmapping to a plurality of first logical registers at each differentlower size.
 5. Apparatus as claimed in claim 1, wherein said secondlogical register specifiers specify second logical registerscorresponding to architectural registers within said register filehaving a plurality of different sizes corresponding to different numbersof words of data up to said maximum number of words of data; and one ofsaid second logical registers of said maximum number of wordscorresponds to a group of architectural registers that at least one ofwhich is mapped by said second mapping to a single second logicalregister at each different lower size.
 6. Apparatus as claimed in claim1, comprising a plurality of physical registers configured to store datavalues to be manipulated and renaming circuitry configured to storeregister mapping data mapping between a bank specifier value and a rowspecifier value identifying an architectural register and one of saidphysical registers to be used in place of said architectural registerfor speculative execution of a program instruction.
 7. Apparatus asclaimed in claim 1, wherein a plurality of architectural registerscorresponding to one of a first logical register or a second logicalregister is identified with register specifying signals transferredwithin said apparatus identifying a single architectural register valuein said common address format and a size qualifier value.
 8. Apparatusas claimed in claim 1, wherein first logical registers corresponding tosaid first logical register specifiers have a size of any of a singleword of data, a double word of data and a quad word of data. 9.Apparatus as claimed in claim 4, wherein said first logical registershave a size of any of a single word of data, a double word of data and aquad word of data and said group of architectural registers correspondsto four first logical registers of a single word of data, two firstlogical registers of a double word of data and one first logicalregister of a quad word of data.
 10. Apparatus as claimed in claim 1,wherein said second logical registers corresponding to said secondlogical register specifiers have a size of any of a single word of data,a double word of data and a quad word of data.
 11. Apparatus as claimedin claim 5, wherein said second logical registers have a size of any ofa single word of data, a double word of data and a quad word of data andsaid group of architectural registers corresponds to four second logicalregisters of a single word of data, two second logical registers of adouble word of data and one second logical register of a quad word ofdata.
 12. Apparatus for processing data comprising: a plurality ofregister means for storing operand values; first decoder means fordecoding program instructions of a first instruction set; and seconddecoder means for decoding program instructions of a second instructionset; wherein program instructions of said first instruction set includefirst logical register specifiers; program instructions of said secondinstruction set include second logical register specifiers; said firstdecoder means maps said first logical specifiers using a first mappingto a common address format; said second decoder means maps said secondlogical specifiers using a second mapping to said common address format;and said second mapping is divergent from said first mapping such thatat least some values used as both a first logical register specifier anda second logical register specifier map to different register means. 13.A method of processing data comprising the steps of: performingprocessing operations with processing circuitry; storing operand valuesin a plurality of registers of a register file; decoding programinstructions of a first instruction set; and decoding programinstructions of a second instruction set; wherein program instructionsof said first instruction set include first logical register specifiers;program instructions of said second instruction set include secondlogical register specifiers; further comprising the steps of: using afirst mapping to map said first logical specifiers to a common addressformat; and using a second mapping to map said second logical specifiersto said common address format; wherein said second mapping is divergentfrom said first mapping such that at least some values used as both afirst logical register specifier and a second logical register specifiermap to different registers.
 14. A method as claimed in claim 13,comprising the steps of addressing said plurality of register as anarray of architectural registers arranged in a plurality of banks and aplurality of rows and said common address format comprises a bankspecifier and a row specifier within said array.
 15. A method as claimedin claim 14, wherein said plurality of banks permit first logicalregisters and second logical registers having said maximum number ofwords to be stored in a single row of said array.
 16. A method asclaimed in claim 13, wherein said first logical register specifiersspecify first logical registers corresponding to architectural registerswithin said register file having a plurality of different sizescorresponding to different numbers of words of data up to a maximumnumber of words of data; and one of said first logical registers of saidmaximum number of words corresponds to a group of architecturalregisters that are all mapped by said first mapping to a plurality offirst logical registers at each different lower size.
 17. A method asclaimed in claim 13, wherein said second logical register specifiersspecify second logical registers corresponding to architecturalregisters within said register file having a plurality of differentsizes corresponding to different numbers of words of data up to saidmaximum number of words of data; one of said second logical registers ofsaid maximum number of words corresponds to a group of architecturalregisters that at least one of which is mapped by said second mapping toa single second logical register at each different lower size.
 18. Amethod as claimed in claim 13, comprising the steps of storing datavalues to be manipulated in a plurality of physical registers andstoring register mapping data mapping between a bank specifier value anda row specifier value identifying an architectural register and one ofsaid physical registers to be used in place of said architecturalregister for speculative execution of a program instruction.
 19. Amethod as claimed in claim 13, comprising the step of identifying aplurality of architectural registers corresponding to one of a firstlogical register or a second logical register with register specifyingsignals identifying a single architectural register value in said commonaddress format and a size qualifier value.
 20. A method as claimed inclaim 13, wherein first logical registers corresponding to said firstlogical register specifiers have a size of any of a single word of data,a double word of data and a quad word of data.
 21. A method as claimedin claim 16, wherein said first logical registers have a size of any ofa single word of data, a double word of data and a quad word of data andsaid group of architectural registers corresponds to four first logicalregisters of a single word of data, two first logical registers of adouble word of data and one first logical register of a quad word ofdata.
 22. A method as claimed in claim 12, wherein second logicalregisters corresponding to said second logical register specifiers havea size of any of a single word of data, a double word of data and a quadword of data.
 23. A method as claimed in claim 17, wherein said secondlogical registers have a size of any of a single word of data, a doubleword of data and a quad word of data and said group of architecturalregisters corresponds to four second logical registers of a single wordof data, two second logical registers of a double word of data and onesecond logical register of a quad word of data.